setTimeout(function () {

var pageBar = new Vue({
    el: '.page-bar',
    data: {
        all: allnum, //总页数
        cur: nows,  //当前页码
    },

    // watch: {
    //     cur: function(oldValue , newValue){
    //         console.log(arguments);
    //     }
    // },

     methods: {
        btnClick: function(data){
            if(data != this.cur){
                this.cur = data;
                window.location.href = '/shopinfo/?pn='+data;
            }
        },
        pageClick: function(){
            console.log('现在在'+this.cur+'页');
            window.location.href = '/shopinfo/?pn='+this.cur;
        },
    },

    computed: {
        indexs: function(){
          var left = 1;
          var right = this.all;
          var ar = [];
          if(this.all>= 5){
          	//这里最大范围从3到6，如果到达7，那么下边加2变成9，已经超过最大的范围值
            if(this.cur > 3 && this.cur < this.all-1){
            	//以4为参考基准，左面加2右边加2
                    left = parseInt(this.cur - 2)
                    right = parseInt(this.cur) + parseInt(2)

            }else{
                if(this.cur<=3){
                    left = 1
                    right = 5
                }else{
                    right = this.all
                    left = this.all -4
                }
            }
         }
        while (left <= right){
            ar.push(left)
            left ++
        }
        return ar
       }
    }
})

},500)
